home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / formats / bwdev201 / bluewave.h < prev    next >
C/C++ Source or Header  |  1994-01-18  |  60KB  |  1,025 lines

  1. /*****************************************************************************/
  2. /*                                                                           */
  3. /*           The Blue Wave Offline Mail System Packet Structures             */
  4. /*     Copyright 1990-1994 by George Hatchew and Cutting Edge Computing      */
  5. /*                 All rights reserved - FidoNet 1:2240/176                  */
  6. /*                                                                           */
  7. /*                     Last Updated - January 18, 1994                       */
  8. /*                                                                           */
  9. /*        ---------------------------------------------------------          */
  10. /*            DISTRIBUTION OF THIS FILE IS LIMITED BY THE TERMS              */
  11. /*           SPECIFIED IN THE BLUE WAVE STRUCTURE DOCUMENTATION!             */
  12. /*        ---------------------------------------------------------          */
  13. /*                                                                           */
  14. /*     These data structures should be usable with any C compiler that       */
  15. /*  supports the ANSI standard for the C language (i.e. ANSI C).  They are   */
  16. /*  NOT guaranteed to be usable with older compilers, which largely relied   */
  17. /*   on the definition of the language as specified in _The C Programming    */
  18. /*       Language (1st Edition)_ by Brian Kernighan & Dennis Ritchie.        */
  19. /*                                                                           */
  20. /*****************************************************************************/
  21.  
  22. #ifndef __BLUEWAVE_H    /*  An extra safeguard to prevent this header from  */
  23. #define __BLUEWAVE_H    /*  being included twice in the same source file    */
  24.  
  25.  
  26. #define PACKET_LEVEL    2       /* The current mail packet revision level, */
  27.                                 /*   used in the "ver" field of the *.INF  */
  28.                                 /*   file header.                          */
  29.  
  30.  
  31. /*
  32. **  This header defines the data structures for the following files in the
  33. **  official Blue Wave offline mail specification:
  34. **
  35. **      Door:       *.INF       BBS and message area information
  36. **                  *.MIX       Quick index to *.FTI records
  37. **                  *.FTI       Information for all packet messages
  38. **                  *.DAT       Packet message text
  39. **
  40. **      Reader:     *.NET       NetMail reply message information
  41. **                  *.UPI       Information for all other reply messages
  42. **                  *.UPL       Reply message information (* NEW *)
  43. **                                  (designed to replace the NET/UPI combo,
  44. **                                  which will soon be obsolete)
  45. **                  *.REQ       List of files to download from BBS
  46. **                  *.PDQ       Offline door configuration information
  47. **
  48. **      Misc:       *.MSG       Fido-style message header
  49. **                                  (used *only* in the *.NET structure, and
  50. **                                  will soon be obsolete)
  51. **                  *.XTI       Extended message packet information
  52. **                                  (not an official part of the Blue Wave
  53. **                                  packet specification; is used by the Blue
  54. **                                  Wave reader only)
  55. **
  56. **  The door files (plus individual files for BBS bulletins) comprise a Blue
  57. **  Wave message packet, and the reader files (plus individual files for each
  58. **  message) comprise a Blue Wave reply packet.
  59. **
  60. **  In order to cover ALL BASES, and to be able to say that you were warned,
  61. **  *ALL* unused fields should be set to ASCII NUL (0).  Any future
  62. **  implementation of reserved fields will rely on the premise that the field
  63. **  will be 0 if not implemented!  The same warning follows for BITMAPPED
  64. **  fields.  If a bit is not implemented or is not used, TURN IT OFF (0).
  65. **  (Clearing an entire structure can be easily accomplished via the memset()
  66. **  function.  Example: "memset(&ftirec, 0, sizeof(FTI_REC))".)
  67. */
  68.  
  69.  
  70. /*****************************************************************************/
  71. /* >>>>>>>>>>>>>>>>>>>>>>>  DATA TYPE DEFINITIONS  <<<<<<<<<<<<<<<<<<<<<<<<< */
  72. /*****************************************************************************/
  73.  
  74.  
  75. /*
  76. **  The data type definitions below help make these structures a little more
  77. **  universal between environments.  The 8-bit, 16-bit, and 32-bit data types
  78. **  defined below can be used as-is with virtually all MS-DOS and OS/2 C/C++
  79. **  compilers, but can be changed if necessary should your compiler define
  80. **  data types in a different fashion.  (Note that the tCHAR and tINT types
  81. **  are currently not used; they are included simply for completeness.)
  82. **
  83. **  If you are programming for a system that employs a CPU which stores multi-
  84. **  byte integers in a manner other than in Intel format (LSB-MSB, or "little
  85. **  endian"), simply #define BIG_ENDIAN before #including this header.  As
  86. **  shown below, this will define the data types as arrays of bytes; the
  87. **  drawback is that *YOU* will have to write functions to convert the data,
  88. **  since the Blue Wave packet specification requires the data to be in Intel-
  89. **  style little-endian format.
  90. **
  91. **  IMPORTANT NOTE ABOUT COMPILERS AND STRUCTURES:
  92. **  All structures *must* be "packed" (i.e., the compiler MUST NOT insert
  93. **  padding bytes between structure elements in order to force elements onto
  94. **  word boundaries).  The Blue Wave products expect them to be packed; if
  95. **  they aren't, you're bound to get some *very* interesting results.
  96. */
  97.  
  98. #ifdef BIG_ENDIAN
  99.  
  100. typedef signed char    tCHAR;     /* 8 bit signed values           */
  101. typedef unsigned char  tBYTE;     /* 8 bit unsigned values         */
  102. typedef unsigned char  tINT[2];   /* little-endian 16 bit signed   */
  103. typedef unsigned char  tWORD[2];  /* little-endian 16 bit unsigned */
  104. typedef unsigned char  tLONG[4];  /* little-endian 32 bit signed   */
  105. typedef unsigned char  tDWORD[4]; /* little-endian 32 bit unsigned */
  106.  
  107. #else
  108.  
  109. typedef signed char    tCHAR;     /* 8 bit signed values    */
  110. typedef unsigned char  tBYTE;     /* 8 bit unsigned values  */
  111. typedef signed short   tINT;      /* 16 bit signed values   */
  112. typedef unsigned short tWORD;     /* 16 bit unsigned values */
  113. typedef signed long    tLONG;     /* 32 bit signed values   */
  114. typedef unsigned long  tDWORD;    /* 32 bit unsigned values */
  115.  
  116. #endif
  117.  
  118.  
  119. /*****************************************************************************/
  120. /* >>>>>>>>>>>>>>>>>>>>>  DOOR DATA FILE STRUCTURES  <<<<<<<<<<<<<<<<<<<<<<< */
  121. /*****************************************************************************/
  122.  
  123.  
  124. /*
  125. **  Name of file:   *.INF
  126. **
  127. **  Description:    The *.INF file is the source of information for just about
  128. **                  everything from the host BBS, as well as definitions for
  129. **                  all of the message areas that are available to the user
  130. **                  and their status (Local, EchoMail, NetMail, Read Only,
  131. **                  etc.).
  132. **
  133. **  File format:    INF_HEADER          { only included one time!        }
  134. **                  INF_AREA_INFO       { repeated for as many msg bases }
  135. **                  INF_AREA_INFO       { as are available to the user   }
  136. **                  ...
  137. */
  138.  
  139. /*  Bit-masks for INF_HEADER.UFLAGS field  */
  140.  
  141. #define INF_HOTKEYS     0x0001      /* User uses "hotkeys" in door prompts   */
  142. #define INF_XPERT       0x0002      /* Short menus displayed in door         */
  143. #define INF_RES1        0x0004      /* RESERVED -- DO NOT USE!               */
  144. #define INF_GRAPHICS    0x0008      /* Enable ANSI control sequences in door */
  145. #define INF_NOT_MY_MAIL 0x0010      /* Do not bundle mail from user          */
  146.  
  147. /*  Bit-masks for INF_HEADER.NETMAIL_FLAGS field  */
  148.  
  149. #define INF_CAN_CRASH   0x0002      /* Allow Crash status          */
  150. #define INF_CAN_ATTACH  0x0010      /* Allow File Attach messages  */
  151. #define INF_CAN_KSENT   0x0080      /* Allow Kill/Sent status      */
  152. #define INF_CAN_HOLD    0x0200      /* Allow Hold status           */
  153. #define INF_CAN_IMM     0x0400      /* Allow Immediate status      */
  154. #define INF_CAN_FREQ    0x0800      /* Allow File Request messages */
  155. #define INF_CAN_DIRECT  0x1000      /* Allow Direct status         */
  156.  
  157. typedef struct      /*  INF_HEADER  */
  158. {
  159.     tBYTE ver;                  /* Packet version type (currently 2)        */
  160.     tBYTE readerfiles[5][13];   /* Files to be displayed by reader          */
  161.     tBYTE regnum[9];            /* User's registration number               */
  162.     tBYTE mashtype;             /* Currently unused (door fills with 0)     */
  163.                                 /*   Reserved for Blue Wave reader to store */
  164.                                 /*   the compression type the packet uses.  */
  165.     tBYTE loginname[43];        /* Name user types at BBS login             */
  166.     tBYTE aliasname[43];        /* User's "other" name                      */
  167.     tBYTE password[21];         /* Password                                 */
  168.                                 /*   All bytes should be the actually ASCII */
  169.                                 /*   value plus 10.  Lame security, yes,    */
  170.                                 /*   but it does prevent "TYPE *.INF" from  */
  171.                                 /*   showing the password.                  */
  172.     tBYTE passtype;             /* Password type                            */
  173.                                 /*   0=none 1=door 2=reader 3=both          */
  174.     tWORD zone;                 /* Main network address of host BBS         */
  175.     tWORD net;                  /*   (zone:net/node.point)                  */
  176.     tWORD node;
  177.     tWORD point;
  178.     tBYTE sysop[41];            /* Name of SysOp of host BBS                */
  179.     tBYTE obsolete1[2];         /* OBSOLETE -- DO NOT USE!                  */
  180.     tBYTE systemname[65];       /* Name of host BBS                         */
  181.     tBYTE maxfreqs;             /* Max number of file requests allowed      */
  182.     tBYTE obsolete2[6];         /* OBSOLETE -- DO NOT USE!                  */
  183.     tWORD uflags;               /* Bit-mapped door options/toggles          */
  184.     tBYTE keywords[10][21];     /* User's entire set of door keywords       */
  185.     tBYTE filters[10][21];      /* User's entire set of door filters        */
  186.     tBYTE macros[3][80];        /* User's door bundling command macros      */
  187.     tWORD netmail_flags;        /* Bit-mapped NetMail options               */
  188.     tWORD credits;              /* NetMail credits                          */
  189.     tWORD debits;               /* NetMail debits                           */
  190.     tBYTE can_forward;          /* 0=Message forwarding not allowed         */
  191.     tWORD inf_header_len;       /* Size of INF_HEADER structure             */
  192.     tWORD inf_areainfo_len;     /* Size of INF_AREA_INFO structure          */
  193.     tWORD mix_structlen;        /* Size of MIX_REC structure                */
  194.     tWORD fti_structlen;        /* Size of FTI_REC structure                */
  195.     tBYTE uses_upl_file;        /* If this field is not zero, the door that */
  196.                                 /*   created this packet can receive reply  */
  197.                                 /*   packets in the new *.UPL file format.  */
  198.                                 /*   Otherwise, the old *.UPI and *.NET     */
  199.                                 /*   files must be used.                    */
  200.     tBYTE from_to_len;          /* The maximum length of the FROM: and TO:  */
  201.                                 /*   fields that the host BBS can support.  */
  202.                                 /*   If this value is 0 or is greater than  */
  203.                                 /*   35, then 35 must be used (the upload   */
  204.                                 /*   file formats only allow for a maximum  */
  205.                                 /*   of 35 characters).                     */
  206.     tBYTE subject_len;          /* The maximum length of the SUBJECT: field */
  207.                                 /*   that the host BBS can support.  If     */
  208.                                 /*   this value is 0 or is greater than 71, */
  209.                                 /*   then 71 must be used (the upload file  */
  210.                                 /*   formats only allow for a maximum of 71 */
  211.                                 /*   characters).                           */
  212.     tBYTE packet_id[9];         /* Original root name of the mail packet,   */
  213.                                 /*   as specified by the mail door.  All    */
  214.                                 /*   files in the packet that are created   */
  215.                                 /*   by the mail door will use this root    */
  216.                                 /*   name, as will the reader when creating */
  217.                                 /*   the upload files.  Thus, even if the   */
  218.                                 /*   packets themselves are renamed to      */
  219.                                 /*   something completely different, the    */
  220.                                 /*   mail doors and readers will still be   */
  221.                                 /*   able to work with the proper files.    */
  222.     tBYTE reserved[234];        /* RESERVED FOR FUTURE USE                  */
  223.                                 /*   This field MUST be filled with ASCII   */
  224.                                 /*   NUL (0x00) characters in order for     */
  225.                                 /*   future additional features to work     */
  226.                                 /*   properly!                              */
  227. }
  228. INF_HEADER;
  229.  
  230. /*
  231. **  Notes about the INF_HEADER.XXXXX_LEN fields, above:
  232. **
  233. **  Door authors should take the few extra lines of code to fill in the
  234. **  structure lengths defined above.  Doing so will make the Blue Wave data
  235. **  structures extensible and adaptable to almost any kind of file change that
  236. **  may be required in the future.  The readers that use this mail packet
  237. **  format should contain code to handle a structure length that is longer or
  238. **  shorter than they expect.
  239. **
  240. **  Reader authors need to take the time to code for possible extensions to
  241. **  this file format.  If the data fields are LONGER than expected, simply do
  242. **  a seek to move to the next record, and ignore the extra information.  If
  243. **  the data fields are SHORTER than expected, a simple "Please upgrade your
  244. **  reader" should suffice. <grin>  However, you should never encounter a
  245. **  record size smaller than the ones defined here.  Any extra information
  246. **  that is sent in the packets probably would not be crucial, and you may be
  247. **  able to continue with reading the packet anyway.
  248. **
  249. **  It should be noted that all current Blue Wave doors set these fields to 0,
  250. **  as this extensibility was not added until recently.  If the structure
  251. **  sizes are 0, the reader will assume that all records are of the sizes
  252. **  defined here.  (Blue Wave readers below version 2.10 do NOT allow for
  253. **  extensible data files.  Version 2.10, and all subsequent versions, WILL
  254. **  handle them properly.)  DO NOT EXTEND THESE STRUCTURE FORMATS WITHOUT
  255. **  NOTIFYING CUTTING EDGE COMPUTING FIRST!  If the extended information will
  256. **  benefit programs/users, it will be officially added to the packet format.
  257. **
  258. **  The original values for the INF_HEADER.XXXXX_LEN structures are as below,
  259. **  defined as macros which you can use in your programs.  Remember, if the
  260. **  value in INF_HEADER.XXXXX_LEN is 0, you must use these values instead!
  261. */
  262.  
  263. #define ORIGINAL_INF_HEADER_LEN     1230    /* Original *.INF header len   */
  264. #define ORIGINAL_INF_AREA_LEN       80      /* Original *.INF area rec len */
  265. #define ORIGINAL_MIX_STRUCT_LEN     14      /* Original *.MIX record len   */
  266. #define ORIGINAL_FTI_STRUCT_LEN     186     /* Original *.FTI record len   */
  267.  
  268. /*
  269. **  Below is some sample C code for reading in the variable length *.INF
  270. **  structure, which is the most "difficult" one to do.  Note the sections of
  271. **  code which use the ORIGINAL_XXXXX_LEN macros; these are the sections that
  272. **  determine the proper structure length.  (Comments are preceeded by "#"
  273. **  signs, since using C comment symbols would make most compilers think that
  274. **  nested comments are in use, a practice which normally is not allowed.)
  275. **
  276. **  int read_inf_file(void)
  277. **  {
  278. **      INF_HEADER    inf_header;
  279. **      INF_AREA_INFO inf_info;
  280. **      FILE          *inf_file=NULL;
  281. **      tWORD         record_num=0u;
  282. **      tWORD         inf_header_slen, inf_area_slen;
  283. **      tLONG         seek_pos=0L;
  284. **
  285. **      inf_file = fopen("WILDBLUE.INF", "rb");
  286. **      if (inf_file == NULL)
  287. **          return 0;
  288. **
  289. **      fread(&inf_header, sizeof(INF_HEADER), 1, inf_file);
  290. **      puts(inf_header.loginname);
  291. **      puts(inf_header.aliasname);
  292. **
  293. **      # Test and verify the validity of the structure lengths.
  294. **
  295. **      if (inf_header.inf_header_len < ORIGINAL_INF_HEADER_LEN)
  296. **          inf_header_slen = ORIGINAL_INF_HEADER_LEN;
  297. **      else
  298. **          inf_header_slen = inf_header.inf_header_len;
  299. **
  300. **      if (inf_header.inf_areainfo_len < ORIGINAL_INF_AREA_LEN)
  301. **          inf_area_slen = ORIGINAL_INF_AREA_LEN;
  302. **      else
  303. **          inf_area_slen = inf_header.inf_areainfo_len;
  304. **
  305. **      # now, move to the END of the header, since it may be longer
  306. **      # than we expect it to be.  Use fseek()...
  307. **
  308. **      fseek(inf_file, (long)inf_header_slen, SEEK_SET);
  309. **
  310. **      record_num = 0U;
  311. **      while(fread(&inf_info, sizeof(INF_AREA_INFO), 1, inf_file))
  312. **      {
  313. **          puts(inf_info.title);
  314. **          record_num++;
  315. **
  316. **          # we need to seek past the header, and then [record_num]
  317. **          # number of recs.
  318. **
  319. **          seek_pos = (long)(inf_header_slen+(record_num*inf_area_slen));
  320. **          fseek(inf_file, seek_pos, SEEK_SET);
  321. **      }
  322. **
  323. **      fclose(inf_file);
  324. **      return 1;
  325. **  }
  326. */
  327.  
  328. /*  Bit-masks for INF_AREA_INFO.AREA_FLAGS field  */
  329.  
  330. #define INF_SCANNING    0x0001  /* On=User is active for area               */
  331. #define INF_ALIAS_NAME  0x0002  /* On=Alias name, Off=Login name            */
  332.                                 /*   If ON, use INF_HEADER.ALIASNAME when   */
  333.                                 /*   addressing new mail or replies for the */
  334.                                 /*   message area.  If OFF, the reader uses */
  335.                                 /*   the INF_HEADER.LOGINNAME for this      */
  336.                                 /*   purpose.                               */
  337. #define INF_ANY_NAME    0x0004  /* On=Allow any name to be entered          */
  338.                                 /*   If ON, any name can be entered in the  */
  339.                                 /*   From: field when addressing new mail   */
  340.                                 /*   or replies for the message area.  If   */
  341.                                 /*   OFF, the normal rules apply.           */
  342. #define INF_ECHO        0x0008  /* On=Network area, Off=Local area          */
  343.                                 /*   The style of network mail depends on   */
  344.                                 /*   the setting of the NETWORK_TYPE field. */
  345. #define INF_NETMAIL     0x0010  /* On=Private network mail                  */
  346.                                 /*   The style of private mail depends on   */
  347.                                 /*   the setting of the NETWORK_TYPE field. */
  348.                                 /*   (If INF_ECHO is off, this field is     */
  349.                                 /*   ignored.)                              */
  350. #define INF_POST        0x0020  /* On=User can post, Off=User CANNOT post   */
  351. #define INF_NO_PRIVATE  0x0040  /* On=Private messages are NOT allowed      */
  352. #define INF_NO_PUBLIC   0x0080  /* On=Public messages are NOT allowed       */
  353. #define INF_NO_TAGLINE  0x0100  /* On=Taglines are not allowed              */
  354.                                 /*   (Not yet implemented in Blue Wave.)    */
  355. #define INF_NO_HIGHBIT  0x0200  /* On=ASCII 1-127 only, Off=ASCII 1-255     */
  356.                                 /*   If ON, only ASCII values 1 to 127 are  */
  357.                                 /*   allowed in messages.  If OFF, all      */
  358.                                 /*   values from 1 to 255 are allowed.  Due */
  359.                                 /*   to the fact that ASCII value 0 is used */
  360.                                 /*   in C as a string terminator, the value */
  361.                                 /*   0 should not be allowed in messages at */
  362.                                 /*   all.                                   */
  363. #define INF_NOECHO      0x0400  /* On=User can prevent messages from being  */
  364.                                 /*   sent through the network               */
  365. #define INF_HASFILE     0x0800  /* On=User can attach files to messages     */
  366.  
  367. /*  Values for INF_AREA_INFO.NETWORK_TYPE field  */
  368.  
  369. #define INF_NET_FIDONET     0   /* Set up for FidoNet-style network mail    */
  370. #define INF_NET_QWKNET      1   /* Set up for QWK packet network mail       */
  371. #define INF_NET_INTERNET    2   /* Set up for Internet/Usenet mail          */
  372.  
  373. typedef struct      /*  INF_AREA_INFO  */
  374. {
  375.     tBYTE areanum[6];       /* Area number this record corresponds to  */
  376.     tBYTE echotag[21];      /* Area tag name (*.BRD name for Telegard) */
  377.     tBYTE title[50];        /* Area description/title                  */
  378.     tWORD area_flags;       /* Bit-mapped area options                 */
  379.     tBYTE network_type;     /* Network mail type (if INF_ECHO set)     */
  380.                             /*   If INF_ECHO is OFF, then this field   */
  381.                             /*   can be ignored.                       */
  382. }
  383. INF_AREA_INFO;
  384.  
  385. /*---------------------------------------------------------------------------*/
  386.  
  387. /*
  388. **  Name of file:   *.MIX
  389. **
  390. **  Description:    The *.MIX file is a very small file, with one record for
  391. **                  every message area that was scanned.  It contains the
  392. **                  information to get into the *.FTI file.
  393. **
  394. **  File format:    MIX_REC     { repeated for each message area scanned }
  395. **                  MIX_REC
  396. **                  ...
  397. */
  398.  
  399. typedef struct      /*  MIX_REC  */
  400. {
  401.     tBYTE areanum[6];   /* Area number this record corresponds to         */
  402.                         /*   This is the ASCII representation of the      */
  403.                         /*   actual area number shown on the host BBS.    */
  404.     tWORD totmsgs;      /* Total number of messages for this area         */
  405.     tWORD numpers;      /* Total number of personal messages in this area */
  406.     tLONG msghptr;      /* Pointer to first message header in *.FTI file  */
  407. }
  408. MIX_REC;
  409.  
  410. /*---------------------------------------------------------------------------*/
  411.  
  412. /*
  413. **  Name of file:   *.FTI
  414. **
  415. **  Description:    The *.FTI file contains the information for each message
  416. **                  in the packet.  Each record includes all of the
  417. **                  information about the message, including the pointer to
  418. **                  the actual message text in the *.DAT file.
  419. **
  420. **                  NOTE:   Messages in the *.FTI file will ALWAYS be in area
  421. **                          number order.  That is to say, if the MIX_REC
  422. **                          indicates there are 100 messages for this area,
  423. **                          all 100 messages will follow in sequential order.
  424. **
  425. **  File format:    FTI_REC     { repeated for as many messages }
  426. **                  FTI_REC     { as obtained from the host BBS }
  427. **                  ...
  428. */
  429.  
  430. /*  Bit-masks for FTI_REC.FLAGS field  */
  431.  
  432. #define FTI_MSGPRIVATE      0x0001  /* Private = For addressee ONLY         */
  433. #define FTI_MSGCRASH        0x0002  /* Crash = High priority mail           */
  434. #define FTI_MSGREAD         0x0004  /* Read = Message read by addressee     */
  435. #define FTI_MSGSENT         0x0008  /* Sent = Message sent                  */
  436. #define FTI_MSGFILE         0x0010  /* File Attach = Send file(s)           */
  437. #define FTI_MSGFWD          0x0020  /* Forward = Message to/from others     */
  438. #define FTI_MSGORPHAN       0x0040  /* Orphan = Message destination unknown */
  439. #define FTI_MSGKILL         0x0080  /* Kill/Sent = Delete after sending     */
  440. #define FTI_MSGLOCAL        0x0100  /* Local = Message originated here      */
  441. #define FTI_MSGHOLD         0x0200  /* Hold = Hold for pickup, don't send   */
  442. #define FTI_MSGIMMEDIATE    0x0400  /* Immediate = Send message NOW         */
  443. #define FTI_MSGFRQ          0x0800  /* File Request = Request file(s)       */
  444. #define FTI_MSGDIRECT       0x1000  /* Direct = Send direct, no routing     */
  445. #define FTI_MSGUNUSED1      0x2000  /*                                      */
  446. #define FTI_MSGUNUSED2      0x4000  /*                                      */
  447. #define FTI_MSGURQ          0x8000  /* Update Request = Req updated file(s) */
  448.  
  449. typedef struct      /*  FTI_REC  */
  450. {
  451.     tBYTE from[36];         /* Person message is from                       */
  452.     tBYTE to[36];           /* Person message is to                         */
  453.     tBYTE subject[72];      /* Subject/title of message                     */
  454.     tBYTE date[20];         /* Origin date of message                       */
  455.                             /*   Depending on the host BBS's date storage   */
  456.                             /*   format, the EXACT format of this field     */
  457.                             /*   will change.  Some will take all 19 bytes, */
  458.                             /*   others may take only 10.                   */
  459.     tWORD msgnum;           /* Number of THIS message on BBS                */
  460.     tWORD replyto;          /* "This is a reply to #xx"                     */
  461.                             /*   Not used for every message.  When non-     */
  462.                             /*   zero, there is a previous message in       */
  463.                             /*   the thread.                                */
  464.     tWORD replyat;          /* "There is a reply at #xx"                    */
  465.                             /*   Not used for every message.  When non-     */
  466.                             /*   zero, there is a reply to this message.    */
  467.     tLONG msgptr;           /* Offset to start of message in *.DAT file     */
  468.                             /*   Seek to this exact offset in the *.DAT     */
  469.                             /*   file, then read "msglength" bytes from     */
  470.                             /*   the file to load the entire message text.  */
  471.     tLONG msglength;        /* Length of message text (in bytes)            */
  472.     tWORD flags;            /* Bit-mapped message status flags              */
  473.     tWORD orig_zone;        /* Origin address of message                    */
  474.                             /*   These three fields will most likely be 0,  */
  475.                             /*   unless the current message belongs to a    */
  476.                             /*   NetMail message base.                      */
  477.     tWORD orig_net;
  478.     tWORD orig_node;
  479. }
  480. FTI_REC;
  481.  
  482. /*---------------------------------------------------------------------------*/
  483.  
  484. /*
  485. **  Name of file:   *.DAT
  486. **
  487. **  Description:    The *.DAT file is an unstructured file which contains the
  488. **                  text of every message obtained from the host BBS.
  489. **                  Valid messages begin with an ASCII space (0x20) character
  490. **                  (which is NOT to be considered part of the message!)
  491. **                  followed by zero or more bytes which constitute the
  492. **                  message text.  The pointer to the text for each message is
  493. **                  stored in FTI_REC.MSGPTR, and the length of the text for
  494. **                  each message is stored in FTI_REC.MSGLENGTH.
  495. **
  496. **  File format:    Unstructured
  497. */
  498.  
  499.  
  500. /*****************************************************************************/
  501. /* >>>>>>>>>>>>>>>>>  MISCELLANEOUS DATA FILE STRUCTURES  <<<<<<<<<<<<<<<<<< */
  502. /*****************************************************************************/
  503.  
  504.  
  505. /*
  506. **  Name of file:   *.MSG
  507. **
  508. **  Description:    The Fido *.MSG message (named for the BBS program on which
  509. **                  it originated) has become a de-facto standard among BBS
  510. **                  implementations, due to the sheer number of utilities
  511. **                  available that operate with *.MSG messages.  It is as
  512. **                  close to a universal message format as one can get in
  513. **                  FidoNet (and FidoNet-style networks), and is the reason
  514. **                  why it is used here (well, the *.MSG header, anyway).
  515. **
  516. **                  NOTE:   Most of the fields in the FTI_REC structure (shown
  517. **                          above) correspond to similar fields in MSG_REC.
  518. **                          This was done deliberately, in order to make
  519. **                          *.FTI file processing a little more intuitive for
  520. **                          programmers.  Also note that MSG_REC is only used
  521. **                          by the NET_REC structure, which will soon become
  522. **                          obsolete (replaced by UPL_REC).
  523. **
  524. **  File format:    MSG_REC         { only included one time!                }
  525. **                  message text    { text can be terminated by an ASCII NUL }
  526. **                                  { character (0x00), or by an ASCII CR,   }
  527. **                                  { LF, NUL (0x0D 0x0A 0x00) sequence      }
  528. */
  529.  
  530. /*  Bit-masks for MSG_REC.ATTR field  */
  531.  
  532. #define MSG_PRIVATE     0x0001  /* Private                */
  533. #define MSG_CRASH       0x0002  /* Crash mail             */
  534. #define MSG_RECEIVED    0x0004  /* Received               */
  535. #define MSG_SENT        0x0008  /* Sent                   */
  536. #define MSG_FATTACH     0x0010  /* File attached          */
  537. #define MSG_INTRANSIT   0x0020  /* In-transit             */
  538. #define MSG_ORPHAN      0x0040  /* Orphaned               */
  539. #define MSG_KILL        0x0080  /* Kill after sending     */
  540. #define MSG_LOCAL       0x0100  /* Local message          */
  541. #define MSG_HOLD        0x0200  /* Hold for pickup        */
  542. #define MSG_RESERVED    0x0400  /* RESERVED               */
  543. #define MSG_FREQ        0x0800  /* File request           */
  544. #define MSG_RREQ        0x1000  /* Return receipt request */
  545. #define MSG_RECEIPT     0x2000  /* Return receipt message */
  546. #define MSG_AREQ        0x4000  /* Audit request          */
  547. #define MSG_FUREQ       0x8000  /* File update request    */
  548.  
  549. typedef struct      /*  MSG_REC (will soon be obsolete)  */
  550. {
  551.     tBYTE from[36];     /* Person message is from                           */
  552.     tBYTE to[36];       /* Person message is to                             */
  553.     tBYTE subj[72];     /* Subject/title of message                         */
  554.     tBYTE date[20];     /* Creation date/time                               */
  555.                         /*   This date/time is usually in either of the     */
  556.                         /*   Fido-sanctioned formats "DD MMM YY  HH:MM:SS"  */
  557.                         /*   or "WWW DD MMM YY HH:MM", but due to the       */
  558.                         /*   chaotic nature of FidoNet-compatible software, */
  559.                         /*   this CANNOT be relied upon!                    */
  560.     tWORD times;        /* Number of times read (fairly obsolete)           */
  561.     tWORD dest;         /* Destination node (of net/node)                   */
  562.     tWORD orig;         /* Origin node (of net/node)                        */
  563.     tWORD cost;         /* Cost of sending message (usually in US cents)    */
  564.     tWORD orig_net;     /* Origin net (of net/node)                         */
  565.     tWORD destnet;      /* Destination net (of net/node)                    */
  566.     tLONG unused1;      /* Undefined                                        */
  567.     tLONG unused2;      /*   Some software (Opus and Maximus, for example)  */
  568.                         /*   uses these fields to store the sent/received   */
  569.                         /*   date/time as bit-packed fields, using the same */
  570.                         /*   format used in MS-DOS directory entries.       */
  571.     tWORD reply;        /* Message # that this message replies to           */
  572.     tWORD attr;         /* Message attributes and behavior flags            */
  573.     tWORD up;           /* Message # that replies to this message           */
  574. }
  575. MSG_REC;
  576.  
  577. /*---------------------------------------------------------------------------*/
  578.  
  579. /*
  580. **  Name of file:   *.XTI
  581. **
  582. **  Description:    The *.XTI file contains extended information for each
  583. **                  message in the packet.  The number of records in the *.XTI
  584. **                  file will always equal the number of messages in the
  585. **                  packet, with each record corresponding to a record in the
  586. **                  *.FTI file (i.e. record #1 in the *.XTI file corresponds
  587. **                  to record #1 in the *.FTI file, and so on).
  588. **
  589. **                  NOTE:   This file is currently created ONLY by the Blue
  590. **                          Wave reader, and is not a part of the official
  591. **                          Blue Wave packet specification; it is merely
  592. **                          documented here for third party programmers to use
  593. **                          if they so desire.  How other readers store which
  594. **                          messages have been read/replied-to/marked is left
  595. **                          as an option to be implemented by the individual
  596. **                          reader authors.  You may use this method if you so
  597. **                          desire; however, PLEASE do not name any external
  598. **                          files not conforming to this specification as
  599. **                          <packet-ID>.XTI, due to the fact that the Blue
  600. **                          Wave reader will expect the file to be in the
  601. **                          format described.  If it's not in the expected
  602. **                          format, things will get interesting. :-)
  603. **
  604. **  File format:    XTI_REC     { repeated for as many messages }
  605. **                  XTI_REC     { as obtained from the host BBS }
  606. **                  ...
  607. */
  608.  
  609. /*  Bit-masks for XTI_REC.FLAGS field  */
  610.  
  611. #define XTI_HAS_READ        0x01    /* Message has been read       */
  612. #define XTI_HAS_REPLIED     0x02    /* Message has been replied to */
  613. #define XTI_IS_PERSONAL     0x04    /* Message is personal         */
  614.  
  615. /*  Bit-masks for XTI_REC.MARKS field  */
  616.  
  617. #define XTI_MARK_SAVE       0x01    /* Message marked for saving   */
  618. #define XTI_MARK_REPLY      0x02    /* Message marked for replying */
  619. #define XTI_MARK_PRINT      0x04    /* Message marked for printing */
  620. #define XTI_MARK_DELETE     0x08    /* Message marked for deletion */
  621.  
  622. typedef struct      /*  XTI_REC  */
  623. {
  624.     tBYTE flags;    /* Bit-mapped message flags   */
  625.     tBYTE marks;    /* Bit-mapped message markers */
  626. }
  627. XTI_REC;
  628.  
  629.  
  630. /*****************************************************************************/
  631. /* >>>>>>>>>>>>>>>>>>>>  READER DATA FILE STRUCTURES  <<<<<<<<<<<<<<<<<<<<<< */
  632. /*****************************************************************************/
  633.  
  634.  
  635. /*
  636. **  Name of file:   *.NET
  637. **
  638. **  Description:    The *.NET file is created ONLY when there is NetMail to be
  639. **                  sent.  It contains the FULL header of the Fido-style *.MSG
  640. **                  structure plus the fields defined below (which aren't part
  641. **                  of the standard *.MSG structure yet required by the door).
  642. **
  643. **  File format:    NET_REC     { repeated for as many NetMail    }
  644. **                  NET_REC     { messages as exist in the packet }
  645. **                  ...
  646. */
  647.  
  648. typedef struct      /*  NET_REC (will soon be obsolete)  */
  649. {
  650.     MSG_REC msg;            /* The Fido-style *.MSG header                */
  651.     tBYTE fname[13];        /* Filename the message text is in            */
  652.     tBYTE echotag[21];      /* NetMail area tag (*.BRD name for Telegard) */
  653.     tWORD zone;             /* Destination zone (of zone:net/node.point)  */
  654.     tWORD point;            /* Destination point (of zone:net/node.point) */
  655.     tLONG unix_date;        /* Date/time of message                       */
  656.                             /*   This Unix-style date/time value (number  */
  657.                             /*   of seconds since 01/01/70) is converted  */
  658.                             /*   to the date/time storage method used by  */
  659.                             /*   the host BBS.                            */
  660. }
  661. NET_REC;
  662.  
  663. /*---------------------------------------------------------------------------*/
  664.  
  665. /*
  666. **  Name of file:   *.UPI
  667. **
  668. **  Description:    The *.UPI file contains the information for each message
  669. **                  in the reply packet, as well as information on the reader
  670. **                  version and registration numbers.  Each record includes
  671. **                  all of the information about the message.
  672. **
  673. **  File format:    UPI_HEADER      { only included one time!        }
  674. **                  UPI_REC         { repeated for as many msg bases }
  675. **                  UPI_REC         { as are available to the user   }
  676. **                  ...
  677. */
  678.  
  679. typedef struct      /*  UPI_HEADER (will soon be obsolete)  */
  680. {
  681.     tBYTE regnum[9];    /* Reader registration number                   */
  682.     tBYTE vernum[13];   /* Reader version number                        */
  683.                         /*   All bytes should be the actually ASCII     */
  684.                         /*   value plus 10.  Lame security, yes, but it */
  685.                         /*   does prevent "TYPE *.UPI" from showing the */
  686.                         /*   version number.                            */
  687.     tBYTE future[33];   /* RESERVED FOR FUTURE USE                      */
  688. #ifdef PAD_SIZES_EVEN
  689.     tBYTE evenpad;      /* If your compiler pads structures out to even */
  690.                         /*   numbered sizes, define PAD_SIZES_EVEN      */
  691.                         /*   before including this header.  When the    */
  692.                         /*   *.UPI file is written, be sure to write    */
  693.                         /*   sizeof(UPI_HEADER) - 1 bytes, otherwise    */
  694.                         /*   your compiler may insert an extra byte not */
  695.                         /*   explicitly specified here.                 */
  696. #endif
  697. }
  698. UPI_HEADER;
  699.  
  700. /*  Bit-masks for UPI_REC.FLAGS field  */
  701.  
  702. #define UPI_RES1        0x01    /* RESERVED FOR FUTURE USE                   */
  703. #define UPI_RES2        0x02    /* RESERVED FOR FUTURE USE                   */
  704. #define UPI_RES3        0x04    /* RESERVED FOR FUTURE USE                   */
  705. #define UPI_RES4        0x08    /* RESERVED FOR FUTURE USE                   */
  706. #define UPI_RES5        0x10    /* RESERVED FOR FUTURE USE                   */
  707. #define UPI_RES6        0x20    /* RESERVED FOR FUTURE USE                   */
  708. #define UPI_PRIVATE     0x40    /* Message is PRIVATE                        */
  709. #define UPI_NO_ECHO     0x80    /* Message is NOT to be echoed               */
  710.                                 /*   This feature is not yet implemented in  */
  711.                                 /*   the Blue Wave reader or doors, as none  */
  712.                                 /*   of the currently supported BBS software */
  713.                                 /*   has support for this feature.           */
  714.  
  715. typedef struct      /*  UPI_REC (will soon be obsolete)  */
  716. {
  717.     tBYTE from[36];     /* Person message is from                     */
  718.     tBYTE to[36];       /* Person message is to                       */
  719.     tBYTE subj[72];     /* Subject/title of message                   */
  720.     tLONG unix_date;    /* Date/time of message                       */
  721.                         /*   This Unix-style date/time value (number  */
  722.                         /*   of seconds since 01/01/70) is converted  */
  723.                         /*   to the date/time storage method used by  */
  724.                         /*   the host BBS.                            */
  725.     tBYTE fname[13];    /* Filename the message text is in            */
  726.     tBYTE echotag[21];  /* Area tag name (*.BRD name for Telegard)    */
  727.     tBYTE flags;        /* Bit-mapped flags                           */
  728.     tBYTE reedit;       /* INTERNAL USE ONLY!                         */
  729.                         /*   This flag is used internally by the Blue */
  730.                         /*   Wave reader.  Doors should ignore this   */
  731.                         /*   field during reply packet processing.    */
  732. }
  733. UPI_REC;
  734.  
  735. /*---------------------------------------------------------------------------*/
  736.  
  737. /*
  738. **  Name of file:   *.UPL
  739. **
  740. **  Description:    The *.UPL file contains the information for each message
  741. **                  in the reply packet, as well as information on the reader
  742. **                  version and registration numbers.  Each record includes
  743. **                  all of the information about the message.
  744. **
  745. **                  NOTE:   The *.UPL file is only generated by the Blue Wave
  746. **                          reader version 2.11 and later.  *.UPL is intended
  747. **                          to eventually replace the *.NET and *.UPI files,
  748. **                          but door authors should code for the possibility
  749. **                          of both instances (however, *.UPL should be used
  750. **                          if present).
  751. **
  752. **  File format:    UPL_HEADER      { only included one time!       }
  753. **                  UPL_REC         { repeated for as many messages }
  754. **                  UPL_REC         { as are included in the packet }
  755. **                  ...
  756. */
  757.  
  758. typedef struct      /*  UPL_HEADER  */
  759. {
  760.     tBYTE regnum[10];       /* Reader registration number (if desired)      */
  761.     tBYTE vernum[20];       /* Reader version number as a string.           */
  762.                             /*   All bytes should be the actually ASCII     */
  763.                             /*   value plus 10.  Lame security, yes, but it */
  764.                             /*   does prevent "TYPE *.UPL" from showing the */
  765.                             /*   version number.                            */
  766.                             /*   Examples:  "2.10a Beta"                    */
  767.                             /*              "2.11"                          */
  768.     tBYTE reader_major;     /* Major version of the reader (number to the   */
  769.                             /*   left of the decimal point)                 */
  770.     tBYTE reader_minor;     /* Minor version of the reader (number to the   */
  771.                             /*   right of the decimal point)                */
  772.     tBYTE reader_name[80];  /* String containing name of the reader, such   */
  773.                             /*   as "The Blue Wave Offline Mail Reader".    */
  774.                             /*   This is provided for door programmers that */
  775.                             /*   wish to display the name of the reader     */
  776.                             /*   that created the reply packet.  (Filling   */
  777.                             /*   it is mandatory but using it is optional.) */
  778.     tWORD upl_header_len;   /* Size of UPL_HEADER structure                 */
  779.     tWORD upl_rec_len;      /* Size of UPL_REC structure                    */
  780.                             /*   NOTE:  Refer to the INF_HEADER section for */
  781.                             /*          more information on using the size  */
  782.                             /*          fields.                             */
  783.     tBYTE loginname[44];    /* Name found in INF_HEADER.LOGINNAME.  This is */
  784.                             /*   provided for door authors as a security    */
  785.                             /*   measure to implement as they wish.         */
  786.     tBYTE aliasname[44];    /* Name found in INF_HEADER.ALIASNAME           */
  787.     tBYTE reader_tear[16];  /* String containing abbreviated name of the    */
  788.                             /*   reader, such as "Blue Wave", "Q-Blue",     */
  789.                             /*   "Wave Rider", etc.  This is provided for   */
  790.                             /*   doors programmers that wish to add to the  */
  791.                             /*   tear line the name of the reader that      */
  792.                             /*   created the reply packet.  (Filling it is  */
  793.                             /*   mandatory but using it is optional.)       */
  794.     tBYTE pad[36];          /* RESERVED FOR FUTURE USE, and to pad struct   */
  795.                             /*   out to a 'nice' 256 bytes                  */
  796. }
  797. UPL_HEADER;
  798.  
  799. /*  Bit-masks for UPL_REC.MSG_ATTR field  */
  800.  
  801. #define UPL_INACTIVE    0x0001  /* Message is INACTIVE                       */
  802.                                 /*   Doors should NOT attempt to import this */
  803.                                 /*   message.                                */
  804. #define UPL_PRIVATE     0x0002  /* Message is PRIVATE                        */
  805. #define UPL_NO_ECHO     0x0004  /* Message is NOT to be echoed               */
  806.                                 /*   This feature is not yet implemented in  */
  807.                                 /*   the Blue Wave reader or doors, as none  */
  808.                                 /*   of the currently supported BBS software */
  809.                                 /*   has support for this feature.           */
  810. #define UPL_HAS_FILE    0x0008  /* Message has file "attached" to it         */
  811.                                 /*   It is up to the door to check the       */
  812.                                 /*   validity of this flag.  If the file is  */
  813.                                 /*   contained in the mail packet, great.    */
  814.                                 /*   If not, the door should probably prompt */
  815.                                 /*   the user to begin uploading the file    */
  816.                                 /*   after importing the messages.  (Not yet */
  817.                                 /*   implemented in the Blue Wave reader.)   */
  818. #define UPL_NETMAIL     0x0010  /* Message is NetMail                        */
  819.                                 /*   Indicates that NetMail-specific fields  */
  820.                                 /*   are utilized, and should be set for     */
  821.                                 /*   messages entered in a FidoNet-style     */
  822.                                 /*   NetMail area.                           */
  823. #define UPL_MRES6       0x0020  /* RESERVED FOR FUTURE USE                   */
  824. #define UPL_MRES7       0x0040  /* RESERVED FOR FUTURE USE                   */
  825. #define UPL_MRES8       0x0080  /* RESERVED FOR FUTURE USE                   */
  826.                                 /* All of the other 8 bits of this field are */
  827.                                 /*   also reserved for future use.  This     */
  828.                                 /*   should provide for plenty of expansion  */
  829.                                 /*   for future development.                 */
  830.  
  831. /*  Bit-masks for UPL_REC.NET_ATTR field  */
  832.  
  833. #define UPL_NRES1           0x0001  /* RESERVED FOR FUTURE USE             */
  834. #define UPL_NETCRASH        0x0002  /* Crash = High priority mail          */
  835. #define UPL_NRES2           0x0004  /* RESERVED FOR FUTURE USE             */
  836. #define UPL_NRES3           0x0008  /* RESERVED FOR FUTURE USE             */
  837. #define UPL_NETFILE         0x0010  /* File Attach = Send file(s) listed   */
  838.                                     /*   in Subject field                  */
  839. #define UPL_NRES4           0x0020  /* RESERVED FOR FUTURE USE             */
  840. #define UPL_NRES5           0x0040  /* RESERVED FOR FUTURE USE             */
  841. #define UPL_NETKILL         0x0080  /* Kill/Sent = Delete after sending    */
  842. #define UPL_NETLOCAL        0x0100  /* Local = Message originated here     */
  843. #define UPL_NETHOLD         0x0200  /* Hold = Hold for pickup, do not send */
  844. #define UPL_NETIMMEDIATE    0x0400  /* Immediate = Send message NOW        */
  845. #define UPL_NETFRQ          0x0800  /* File Request = Request file(s)      */
  846.                                     /*   listed in Subject field           */
  847. #define UPL_NETDIRECT       0x1000  /* Direct = Send direct, no routing    */
  848. #define UPL_NRES6           0x2000  /* RESERVED FOR FUTURE USE             */
  849. #define UPL_NRES7           0x4000  /* RESERVED FOR FUTURE USE             */
  850. #define UPL_NETURQ          0x8000  /* Update Request = Request updated    */
  851.                                     /*   file(s) listed in Subject field   */
  852.  
  853. typedef struct
  854. {
  855.     tBYTE from[36];         /* Person message is from                        */
  856.                             /*   NOTE: Doors should validate this field!     */
  857.     tBYTE to[36];           /* Person message is to                          */
  858.     tBYTE subj[72];         /* Subject/Title of message                      */
  859.     tWORD destzone;         /* Destination zone of message (NetMail only)    */
  860.                             /*   If the message is not a FidoNet NetMail     */
  861.                             /*   message, this field (and the subsequent     */
  862.                             /*   three fields as well) should be set to      */
  863.                             /*   zero.                                       */
  864.     tWORD destnet;          /* Destination net of message (NetMail only)     */
  865.     tWORD destnode;         /* Destination node of message (NetMail only)    */
  866.     tWORD destpoint;        /* Destination point of message (NetMail only)   */
  867.     tWORD msg_attr;         /* Bit-mapped message attributes                 */
  868.     tWORD netmail_attr;     /* Bit-mapped NetMail message attributes         */
  869.     tLONG unix_date;        /* Date/time of message                          */
  870.                             /*   This Unix-style date/time value (number     */
  871.                             /*   of seconds since 01/01/70) is converted to  */
  872.                             /*   the date/time storage method used by the    */
  873.                             /*   host BBS.                                   */
  874.     tDWORD replyto;         /* This unsigned long word stores the message #  */
  875.                             /*   that this message is a reply to.  This      */
  876.                             /*   should be the same as FTI.MSGNUM.  Note,    */
  877.                             /*   however, that FTI.MSGNUM is a word.  C      */
  878.                             /*   programmers especially will need to         */
  879.                             /*   properly typecast the value (i.e.           */
  880.                             /*   upl.replyto=(tDWORD)fti.msgnum).  As        */
  881.                             /*   messaging/BBS systems become more complex,  */
  882.                             /*   FTI.MSGNUM may become obsolete, and a       */
  883.                             /*   tDWORD variable may be used in its place.   */
  884.     tBYTE filename[13];     /* Filename the message text is in               */
  885.                             /*   If this file does not exist in the upload   */
  886.                             /*   packet then doors should consider this an   */
  887.                             /*   invalid record.                             */
  888.     tBYTE echotag[21];      /* Area tag the message goes in                  */
  889.                             /*   This must correspond exactly to the         */
  890.                             /*   INF_AREA_INFO.ECHOTAG field for the message */
  891.                             /*   area this message belongs to.  Simple area  */
  892.                             /*   number matching has proven not to work      */
  893.                             /*   simply because sysops are finicky people,   */
  894.                             /*   and seem to constantly renumber/change the  */
  895.                             /*   message area numbers on the host BBS.       */
  896.                             /*   Using an echotag helps to alleviate this    */
  897.                             /*   problem.  C_ECHO will be C_ECHO on the BBS, */
  898.                             /*   whether it is msg area 17 on the host BBS   */
  899.                             /*   or whether it is area 207. Doors should do  */
  900.                             /*   a case-INSENSITIVE compare on this field to */
  901.                             /*   find where the message belongs.             */
  902.     tWORD area_flags;       /* The Blue Wave Offline Mail Reader uses this   */
  903.                             /*   word internally to store the same value as  */
  904.                             /*   in INF_AREA_INFO.AREA_FLAGS.  The purpose   */
  905.                             /*   of this word is to hold the original        */
  906.                             /*   information about the message area so that  */
  907.                             /*   later message editing processes can be      */
  908.                             /*   controlled properly.  For example, if a     */
  909.                             /*   user later wanted to edit this message, the */
  910.                             /*   reader would know instantly whether this is */
  911.                             /*   a NETMAIL area, whether PVT messages are    */
  912.                             /*   allowed, etc.  This allows re-editing of    */
  913.                             /*   the message, even when there is not a       */
  914.                             /*   corresponding *.INF file laying around, or  */
  915.                             /*   the area is not listed in the *.INF file    */
  916.                             /*   you currently have to work with.  DOOR      */
  917.                             /*   AUTHORS SHOULD IGNORE THIS FIELD WHEN       */
  918.                             /*   IMPORTING MESSAGES!                         */
  919.     tBYTE f_attach[13];     /* If the UPL_HAS_FILE flag is set, this field   */
  920.                             /*   will contain the file name that is attached */
  921.                             /*   to the message.                             */
  922.     tBYTE user_area[7];     /* User-defined storage.  Doors should ignore    */
  923.                             /*   this field, and reader authors should feel  */
  924.                             /*   free to utilize this field for their own    */
  925.                             /*   internal use, if necessary.                 */
  926.     tBYTE net_dest[100];    /* Network destination address                   */
  927.                             /*   If the message is for a non-FidoNet network */
  928.                             /*   message area, this field will contain the   */
  929.                             /*   ASCII representation of the destination     */
  930.                             /*   address.                                    */
  931. }
  932. UPL_REC;
  933.  
  934. /*---------------------------------------------------------------------------*/
  935.  
  936. /*
  937. **  Name of file:   *.REQ
  938. **
  939. **  Description:    The *.REQ file is simply a list of filenames the user
  940. **                  wants to request from the host BBS.  Wildcard characters
  941. **                  ("*" and "?" under MS-DOS) are allowed, but are not
  942. **                  guaranteed to produce accurate results on all door
  943. **                  implementations.
  944. **
  945. **                  NOTE:   Current Blue Wave doors do not accept wildcard
  946. **                          characters in filenames, and will consider any
  947. **                          filenames which contain them as being invalid.
  948. **                          Additionally, if there are more than 10 entries in
  949. **                          the *.REQ file, current Blue Wave doors will read
  950. **                          the first 10 and discard the rest.  These are
  951. **                          limitations of the Blue Wave doors, not of the
  952. **                          Blue Wave format itself.
  953. **
  954. **  File format:    REQ_REC     { repeated for as many files as }
  955. **                  REQ_REC     { requested from the host BBS   }
  956. **                  ...
  957. */
  958.  
  959. typedef struct      /*  REQ_REC  */
  960. {
  961.     tBYTE filename[13];     /* Name of file to request */
  962. }
  963. REQ_REC;
  964.  
  965. /*---------------------------------------------------------------------------*/
  966.  
  967. /*
  968. **  Name of file:   *.PDQ
  969. **
  970. **  Description:    The *.PDQ file contains the information used for the
  971. **                  offline configuration feature of the mail door.  After the
  972. **                  header is a series of records which indicate the message
  973. **                  areas to enable for scanning the next time a mail packet
  974. **                  is requested.
  975. **
  976. **                  NOTE:   If the AREA_CHANGES flag in PDQ_HEADER.FLAGS is
  977. **                          set, the door should process the offline
  978. **                          configuration as well as changes to the list of
  979. **                          areas the user wants to download.  In the Blue
  980. **                          Wave door, this is done by first turning OFF all
  981. **                          message areas that were active, then turning ON
  982. **                          the ones specified in the *.PDQ file.  This seems
  983. **                          to be the simplest, most straight-forward method
  984. **                          of accomplishing this task, though other, more
  985. **                          complex schemes could easily have been devised.
  986. **
  987. **  File format:    PDQ_HEADER      { only included one time!
  988. **                  PDQ_REC         { repeated for as many message areas }
  989. **                  PDQ_REC         { as the user wishes to enable       }
  990. **                  ...
  991. */
  992.  
  993. /*  Bit-masks for PDQ_HEADER.FLAGS field  */
  994.  
  995. #define PDQ_HOTKEYS         0x0001  /* Toggle "hotkeys" in prompts        */
  996. #define PDQ_XPERT           0x0002  /* Toggle expert mode (menu displays) */
  997. #define PDQ_AREA_CHANGES    0x0004  /* Change active message areas        */
  998. #define PDQ_GRAPHICS        0x0008  /* Toggle IBM 8-bit ASCII characters  */
  999. #define PDQ_NOT_MY_MAIL     0x0010  /* Toggle bundling mail from user     */
  1000.  
  1001. typedef struct      /*  PDQ_HEADER  */
  1002. {
  1003.     tBYTE keywords[10][21];     /* User's entire set of door keywords  */
  1004.     tBYTE filters[10][21];      /* User's entire set of door filters   */
  1005.     tBYTE macros[3][78];        /* User's door bundling command macros */
  1006.     tBYTE password[21];         /* Password                            */
  1007.     tBYTE passtype;             /* Password type                       */
  1008.                                 /*   0=none 1=door 2=reader 3=both     */
  1009.     tWORD flags;                /* Bit-mapped flags                    */
  1010. }
  1011. PDQ_HEADER;
  1012.  
  1013. typedef struct      /*  PDQ_REC  */
  1014. {
  1015.     tBYTE echotag[21];      /* Echo tag of message area to activate    */
  1016.                             /*   With Telegard systems, this should    */
  1017.                             /*   be the name of the *.BRD file, rather */
  1018.                             /*   than the actual echo tag.             */
  1019. }
  1020. PDQ_REC;
  1021.  
  1022. /*---------------------------------------------------------------------------*/
  1023.  
  1024. #endif      /*  __BLUEWAVE_H  */
  1025.